package com.geline.mybatisplus.annotation;

import com.geline.mybatisplus.handler.EntityFieldHandler;
import com.geline.mybatisplus.handler.impl.SnowflakeIdHandler;

import java.lang.annotation.*;

/**
 * 自定义注解@TableFieldBsm，用于insert之前自动设置值(id or bsm)操作
 *  放在Entity属性上，支持1个
 *      @TableFieldBsm
 *  or  @TableFieldBsm(handler = BsmKeyHandler.class)
 *
 * @author: mengxin
 * @date: 2023/11/13 14:35
 */
@Documented
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface TableFieldBsm {

    //执行handler
    Class<? extends EntityFieldHandler> handler() default SnowflakeIdHandler.class;
}
